package 面向对象.实验六;

import java.io.Serializable;

/**
 * @projectName: JAVA编程
 * @package: 面向对象.实验六
 * @className: Book
 * @author: hhy帅
 * @description: TODO
 * @date: 2021/11/7 21:16
 */
public class Book implements Comparable, Serializable {
    private String ibsn;
    private String title;
    private String author;

    public Book(String ibsn, String title, String author) {
        this.ibsn = ibsn;
        this.title = title;
        this.author = author;
    }

    public String getIbsn() {
        return ibsn;
    }

    public String getTitle() {
        return title;
    }

    public String getAuthor() {
        return author;
    }

    @Override
    public String toString() {
        return "Book{" +
                "ibsn='" + ibsn + '\'' +
                ", title='" + title + '\'' +
                ", author='" + author + '\'' +
                '}';
    }

    @Override
    public int compareTo(Object o) {
        return ibsn.compareTo(((Book)o).ibsn);
    }
}
